using System;
using System.Collections.Generic;
using System.Text;

namespace R2ML
{
    public class Conditions
    {
        private DatatypePredicateAtom _datatypePredicateAtomField;
        private ObjectClassificationAtom _objectClassificationField;
        private AttributionAtom _attributionAtomField;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("ObjectClassificationAtom")]
        public ObjectClassificationAtom objectClassificationAtom
        {
            get
            {
                return _objectClassificationField;
            }
            set
            {
                _objectClassificationField = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute("DatatypePredicateAtom")]
        public DatatypePredicateAtom datatypePredicateAtom
        {
            get
            {
                return _datatypePredicateAtomField;
            }
            set
            {
                _datatypePredicateAtomField = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute("AttributionAtom")]
        public AttributionAtom attributionAtom
        {
            get
            {
                return _attributionAtomField;
            }
            set
            {
                _attributionAtomField = value;
            }
        }

        public class DatatypePredicateAtom
        {
            
            [System.Xml.Serialization.XmlAttribute("datatypePredicateID")]
            public String _datatypePredicateID;

            public class dataArguments
            {
                [System.Xml.Serialization.XmlArrayItem("AttributeFunctionTerm")]
                public AttributeFunctionTerm[] attributeFunctionTerm;

                public TypedLiteral typedLiteral;

                public class AttributeFunctionTerm
                {
                    [System.Xml.Serialization.XmlArrayItem("contextArgument")]
                    public contextArguement[] contextArguments;
                }
            }
        }

        public class AttributionAtom
        {
            //not implemented. Production rule example uses this. Not sure if it is required for Reaction rules.
        }
    }

    ///<R2ML examples />
    
    ///<R2ML Reaction Rule Example1 />
    ///<r2ml:conditions>
    ///  <r2ml:DatatypePredicateAtom r2ml:datatypePredicateID="swrlb:greaterThan">
    ///    <r2ml:dataArguments>
    ///      <r2ml:AttributeFunctionTerm r2ml:attributeID="srv:lastservice">
    ///        <r2ml:contextArgument>
    ///        <r2ml:ObjectVariable r2ml:name="rentalCar" r2ml:classID="srv:RentalCar"/>
    ///       </r2ml:contextArgument>
    ///      </r2ml:AttributeFunctionTerm>
    ///        <r2ml:AttributeFunctionTerm r2ml:attributeID="odometer_reading">
    ///          <r2ml:contextArgument>
    ///          <r2ml:ObjectVariable r2ml:name="rentalCar" r2ml:classID="srv:RentalCar"/>
    ///        </r2ml:contextArgument>
    ///      </r2ml:AttributeFunctionTerm>
    ///      <r2ml:TypedLiteral r2ml:datatypeID="xs:positiveInteger" r2ml:lexicalValue="5000"/>
    ///    </r2ml:dataArguments>
    ///  </r2ml:DatatypePredicateAtom>
    ///</r2ml:conditions>
    /// 
    ///</R2ML Reaction Rule Example2 />
    ///<r2ml:conditions>
	///  <r2ml:ObjectClassificationAtom r2ml:classID="srv:AvailableCar">
    ///    <r2ml:ObjectVariable r2ml:name="car"/>
    ///  </r2ml:ObjectClassificationAtom>
    ///</r2ml:conditions>

    ///<R2ML Production Rule Example>
    ///<r2ml:conditions>
	///     <r2ml:AttributionAtom r2ml:attributeID="userv:Car.convertible">
	///         <r2ml:subject>
    ///             <r2ml:ObjectVariable r2ml:name="car" r2ml:classID="userv:Car"/>
    ///         </r2ml:subject>
	///         <r2ml:dataValue>
    ///             <r2ml:TypedLiteral r2ml:lexicalValue="true" r2ml:datatypeID="xs:boolean"/>
    ///         </r2ml:dataValue>
    ///     </r2ml:AttributionAtom>
    ///</r2ml:conditions>
    ///</R2ML Production Rule Example>

}
